{% extends 'AdminBundle::layout.html.twig' %}

{% block title %}编辑项目-申报看板{% endblock %}

{% block css %}{% endblock %}


    {% block top %}
        {#{{ dump() }}#}
        {{ parent() }}
    {% endblock %}


    {% block left_body_top %}
        {{ parent() }}
    {% endblock %}


    {% block left_body %}
        {{ parent() }}
    {% endblock %}

    {% block right_body %}
    <div class="page-header">
        <div class="page-right-top">
            <div class="right-top">
                <span class="right-title">申报看板</span>
            </div>
            <div class="top-nav top-nav-active">项目详情</div>
        </div>
        <div class="main-content">
            <div class="mes-content" style="margin-top: 0;">

                <div style="padding: 20px 17px;">
                    <div class="com-item">
                        <div class="l-com-left fl a-line">项目名称</div>
                        <div class="l-com-right a-line">{{ data.data.name }}</div>
                        <div class="clearfix"></div>
                    </div>

                    <div class="com-item">
                        <div class="l-com-left fl">项目类型</div>
                        <div class="l-com-right">{{ data.data.type }}</div>
                        <div class="clearfix"></div>
                    </div>

                    <div class="com-item">
                        <div class="fl">
                            <div class="l-com-left fl a-line">项目进度</div>
                            <div class="l-com-right a-line project-curr-length">
                                {% for key,item in data.data.progress %}
                                    {% if data.curr_date <= item.end_at|slice(0,10) and data.curr_date >= item.start_at|slice(0,10) %}
                                        <span class="list-progress">
                                            <span class="index-left" style="display: none;">,</span>
                                            <spqn class="curr-progress-name">{{ item.name }}</spqn>
                                        </span>



                                    {% endif %}

                                {% endfor %}
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="clearfix"></div>
                    </div>

                    <div class="com-item">
                        <div class="fl">
                            <div class="l-com-left fl">节点日期</div>
                            <div class="l-com-right">
                                <table class="table table-hover" style="table-layout:fixed;width: 600px;">
                                    <thead>
                                    <tr style="background-color: #f3f9fd;">
                                        <th class="center-th">开始时间</th>
                                        <th class="center-th">截止时间</th>
                                        <th class="center-th">项目进度</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                        {% for key,item in data.data.progress %}
                                            {% if data.curr_date <= item.end_at|slice(0,10) and data.curr_date >= item.start_at|slice(0,10) %}
                                                <tr style="color: #1385dd;">
                                            {% else %}
                                                <tr >
                                            {% endif %}
                                                    <td class="center-th">{{ item.start_at }}</td>
                                                    <td class="center-th">{{ item.end_at }}</td>
                                                    <td class="center-th">{{ item.name }}</td>
                                                </tr>
                                        {% endfor %}


                                        {#<tr style="color: #1385dd;">#}
                                            {#<td class="center-th">2017-5-10</td>#}
                                            {#<td class="center-th">2017-6-10</td>#}
                                            {#<td class="center-th">项目审核中</td>#}
                                        {#</tr>#}

                                    </tbody>
                                </table>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="clearfix"></div>
                    </div>

                    <div class="com-item">
                        <div class="fl">
                            <div class="l-com-left fl">项目文件</div>
                            <a href="{{ asset('')~data.data.attachment.path }}" class="l-com-right">
                                <span class="down-text fl">{{ data.data.attachment.origin_name }}</span>
                                <span class="down-icon"></span>
                            </a>
                            <div class="clearfix"></div>
                        </div>
                        <div class="clearfix"></div>
                    </div>

                    <div class="add-mem-box" style="margin-top: 40px;">
                        <div class="mem-left fl"></div>
                        <a class="acc-opera-btn fl mem-btn" style="margin-left: 42px;" href="{{ path('project_list') }}">返回</a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    {% endblock %}


{% block box %}
{% endblock %}

{% block javascript %}
<script type="text/javascript">
    $(function () {
        SidebarHighlighting('5');

        var curr_process_length = $(".list-progress").length;

        if(curr_process_length == 0){

            $(".project-curr-length").text("无");

        }


        $(".list-progress").each(function(){
            var index = $(this).index();
            if(index > 0){
                $(this).find(".index-left").show();
            }
        })
    })
</script>
{% endblock %}